package dfbz.com.controller.view;

import dfbz.com.controller.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet("/view/*")
public class UIServlet extends BaseServlet {

    public void home(HttpServletRequest req, HttpServletResponse resp) throws Exception{
            req.getRequestDispatcher("/html/home.jsp").forward(req, resp);
    }

    public void index(HttpServletRequest req, HttpServletResponse resp) throws Exception{
            req.getRequestDispatcher("/index.jsp").forward(req, resp);

    }

    public void register(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        req.getRequestDispatcher("/register.jsp").forward(req, resp);

        //去除显示在页面上的错误信息
//        req.getSession().removeAttribute("registerError");
//        Object mag = req.getSession().getAttribute("registerError");
//        System.out.println("删除错误信息后："+mag);
    }


    public void forget(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        req.getRequestDispatcher("/forget.jsp").forward(req, resp);
    }

}
